/**
 * 
 */
package com.csc.bankingsystem.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;

import com.csc.bankingsystem.core.entity.UserInfo;
import com.csc.bankingsystem.core.service.UserInfoService;
import com.csc.bankingsystem.core.util.ConstantManager;

/**
 * @author angelkid
 *
 */
public class BSAbstractController {

	@Autowired
	UserInfoService userInfoService;

	public UserInfo getCurrentUser(HttpServletRequest request) {
		return userInfoService.find((Long) request.getSession().getAttribute(
				ConstantManager.CURRENT_USER_ID));
	}
}
